package com.tbit.uqbike.webmanager.dao.core;

import com.tbit.uqbike.object.business.NoticeSearch;
import com.tbit.uqbike.object.business.NoticeStatisticsSearch;
import com.tbit.uqbike.object.pojo.NoticeStatistics;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.*;

/**
 * 公告统计表(NoticeStatistics)表数据库访问层
 *
 * @author shanyong.mo
 * @since 2025-02-19 10:57:37
 */
@Mapper
@Repository
public interface NoticeStatisticsDao {

    /**
     * @description: 分页查询
     * @author: mo.shanyong
     * @date: 2025/2/20 10:14
     * @param: noticeStatisticsSearch 查询条件
     * @param: offset 起始下标
     * @param: pageSize 页长
     * @return: java.util.List<com.tbit.uqbike.object.pojo.NoticeStatistics>
     */
    List<NoticeStatistics> queryAllByLimit(@Param("noticeStatisticsSearch") NoticeStatisticsSearch noticeStatisticsSearch, @Param("offset") Integer offset, @Param("pageSize") Integer pageSize);

    /**
     * 统计总行数
     *
     * @param noticeStatisticsSearch 查询条件
     * @return 总行数
     */
    int count(@Param("noticeStatisticsSearch") NoticeStatisticsSearch noticeStatisticsSearch);

    /**
     * 新增数据
     *
     * @param noticeStatistics 实例对象
     * @return 影响行数
     */
    int insert(NoticeStatistics noticeStatistics);

    /**
     * 新增数据（判空）
     *
     * @param noticeStatistics 实例对象
     * @return 影响行数
     */
    int insertCheckNull(NoticeStatistics noticeStatistics);

    /**
     * 批量新增数据（MyBatis原生foreach方法）
     *
     * @param entities List<NoticeStatistics> 实例对象列表
     * @return 影响行数
     */
    int insertBatch(@Param("entities") List<NoticeStatistics> entities);

    /**
     * 修改数据（判空）
     *
     * @param noticeStatistics 实例对象
     * @return 影响行数
     */
    int updateCheckNull(NoticeStatistics noticeStatistics);

}

